//
//  KAExitReasonModel.swift
//  kano
//
//  Created by Frank on 2025/5/15.
//

import UIKit
import KakaJSON


class KAExitReasonModel: Convertible, Codable {

    var cellHeight: Double = 0.0
    var open: Bool = false
    var entityIdentifier: Int = 0
    var nextRepaymentvalue: Int = 0
    var actualDeductionAmount: String = ""
    var templateDesignation: String = ""
    var secondaryLevelAccess : [KAExitReasonModel] = []
    
    func kj_didConvertToModel(from json: [String : Any]) {
        self.open = false
        let contentLabel = UILabel()
        contentLabel.numberOfLines = 0
        contentLabel.text = self.templateDesignation
        if (self.nextRepaymentvalue == 1) {
            contentLabel.font = UIFont.systemFont(ofSize: kscale(12), weight: .medium)
            self.cellHeight = contentLabel.sizeThatFits(CGSize(width: var_screenWidth - kscale(106), height: Double(MAXFLOAT))).height + kscale(16)
        } else {
            contentLabel.font = UIFont.systemFont(ofSize: kscale(14), weight: .medium)
            self.cellHeight = contentLabel.sizeThatFits(CGSize(width: var_screenWidth - kscale(66), height: Double(MAXFLOAT))).height + kscale(28)
        }
    }
    
    required init() {
        
    }
}
